package serviceimpl;

import mapper.LineMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import po.Line;
import po.Sight;
import service.LineService;

import java.util.List;

/**
 * Created by apple on 2017/10/21.
 */

@Component
public class LineServiceImpl implements LineService {


    @Autowired
    private LineMapper lineMapper;

    @Override
    public boolean createLineInfo(Line line) {
        return lineMapper.insertLine(line);
    }

    @Override
    public boolean deleteLineInfo(Line line) {
        return lineMapper.deleteLineByName(line.getLinename());
    }

    @Override
    public boolean updateLineInfo(Line line) {
        return lineMapper.updateLineById(line);
    }

    @Override
    public Line selectLineByLineId(Integer lineid) {
        return lineMapper.selectLineById(lineid);
    }

    @Override
    public Line selectLineByLineName(String linename) {
        return lineMapper.selectLineByName(linename);
    }

    @Override
    public List<Line> selectLinesByCompanyId(Integer companyid) {
        return lineMapper.selectLineByCompanyId(companyid);
    }

    @Override
    public List<Line> selectAllLinesIncludeSight(Sight sight) {
        return null;
    }

    @Override
    public List<Line> selectAllLinesInfo() {
        return lineMapper.selectAllLines();
    }

}
